package com.tf_cut.backend.seller.enums;

/**
 * 通知接口地址与对应通知策略实现的bean id
 **/
public enum FunctionEnum {
    VOSTRO_NOTIFY("ant.mybank.bkcloudfunds.vostro.notify", "bkcloudfundsVostroNotifyService"),
    RECEIPT_NOTIFY("ant.mybank.bkcloudfunds.balance.receipt.apply.notify", "bkcloudfundsReceiptNotifyService"),
    COMANAGEMENT_PAYMENT_NOTIFY("ant.mybank.bkcloudfunds.comanagement.payment.notify", "bkcloudfundsComanagementPaymentNotifyService"),
    REFUND_NOTIFY("ant.mybank.bkcloudfunds.refund.notify", "bkcloudfundsRefundNotifyService");


    private String functionKey;
    private String strategyValue;

    FunctionEnum(String functionKey, String strategyValue) {
        this.functionKey = functionKey;
        this.strategyValue = strategyValue;
    }

    public static String getStrategyValue(String functionKey) {
        FunctionEnum[] functionEnums = values();
        for (FunctionEnum functionEnum : functionEnums) {
            if (functionEnum.functionKey().equals(functionKey)) {
                return functionEnum.strategyValue();
            }
        }
        return null;
    }

    public static String getFunctionKey(String strategyValue) {
        FunctionEnum[] functionEnums = values();
        for (FunctionEnum functionEnum : functionEnums) {
            if (functionEnum.strategyValue().equals(strategyValue)) {
                return functionEnum.functionKey();
            }
        }
        return null;
    }

    private String functionKey() {
        return this.functionKey;
    }

    private String strategyValue() {
        return this.strategyValue;
    }

}